package com.hawk.eye.server.convert;

import com.hawk.eye.api.storage.dto.LogMessageDTO;
import com.hawk.eye.server.domain.dto.resp.AlarmBaseLogRespDTO;
import com.hawk.eye.server.domain.po.AlarmBaseLog;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zd
 */
@Mapper
public interface AlarmLogConvert {

    AlarmLogConvert INSTANCE = Mappers.getMapper(AlarmLogConvert.class);

    AlarmBaseLog to(LogMessageDTO sourceDTO);

    @Named("alarmBaseLogToAlarmBaseLogRespDTO")
    AlarmBaseLogRespDTO to(AlarmBaseLog alarmBaseLog);

    @IterableMapping(qualifiedByName = "alarmBaseLogToAlarmBaseLogRespDTO")
    List<AlarmBaseLogRespDTO> to(List<AlarmBaseLog> alarmBaseLogs);


}